class make_adder(object):

    def __init__(self, a):
        self.a = a

    def __call__(self, b):
        return self.a + b

add3 = make_adder(3)
add4 = make_adder(4)
print add3(10)
print add4(10)


class addable(object):

    def __init__(self, state):
        self.state = state

    def __add__(self, other):
        return self.state + other.state

def fn():
    pass

fn.state = "a"

print make_adder("b")(fn)
